Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Constants and Data Types


The TUnitReply Structure

You use the TUnitReply structure to specify the data being sent with the OTSndUReply function (page 3-112) and the data being read with the OTRcvUReply function (page 3-115). You pass a pointer to the TUnitReply structure as a parameter to each of these functions.

The TUnitReply structure is defined by the TUnitReply data type.

struct TUnitReply
   {
      TNetbuf     addr;
      TNetbuf     opt;
      TNetbuf     udata;
      OTSequence  sequence;
   };
   typedef struct TUnitReplyTUnitReply;
Field Description
addr
A TNetbuf structure that contains information about
an address.
In the reply parameter to the OTSndUReply function, this field specifies the location and size of a buffer containing the address of the requester. You are not required to provide this information. If you do not want to provide address information, set the addr.len field to 0. To specify an address, you must allocate a buffer for the address and initialize it to the destination address. Then you set the addr.buf field to point to the buffer and set the addr.len field to the length of the address.
In the reply parameter to the OTRcvUReply function, this field specifies the location and size of a buffer containing the address of the endpoint sending the reply. You must allocate a buffer into which the address is placed when the function returns, and you must set the addr.buf field to point to this buffer. You must also set the addr.maxlen field to the maximum size of the buffer.
opt
A TNetbuf structure that contains information about the options associated with this reply.
In the reply parameter to the OTSndUReply function, this field specifies the location and size of a buffer containing the options that you set for this reply. You must set the opt.len field to the length of the options or to 0 if you don't want to specify any options.
In the reply parameter to the OTRcvUReply function, this field specifies the location and size of a buffer containing the association-related options that the responder has sent using the OTSndUReply function. You must allocate a buffer to hold option information and set the reply.opt field to point to it. When the OTRcvUReply function returns, it fills this buffer with option information. You must set the reply.maxlen field to the maximum size necessary to hold option information.
udata
A TNetbuf structure that contains information about the reply data.
In the reply parameter to the OTSndUReply function, this field specifies the location and size of a buffer containing the reply data sent to the requester. You allocate a buffer that contains the reply data, set the udata.buf field to point to that buffer, and set the udata.len field to specify the size of the reply. The size cannot exceed the value specified for the tsdu field of the TEndpointInfo structure for the endpoint.
If you are sending data that is not stored contiguously, the udata.buf field is a pointer to an OTData structure that describes the first data fragment. In this case, you must set the udata.len field to kNetbufDataIsOTData.
In the reply parameter to the OTRcvUReply function, this field specifies the location and size of a buffer into which the function places the reply data on return. You must allocate a buffer to hold the data, set the udata.buf field to point to it, and set the udata.maxlen field to the maximum size of this buffer. The size must not exceed the value specified for the tsdu field of the TEndpointInfo structure for this endpoint.
If you are doing a no-copy receive, the udata.buf field is a pointer to an OTBuffer pointer. In this case, you must set the udata.maxlen field to the constant kNetbufDataIsOTBufferStar.
sequence
A long that specifies the transaction ID for this transaction.
When sending a reply, you set this field to the value for this field that you read with the OTRcvURequest function.
When receiving a reply, if you have sent out multiple requests, you use this field to match incoming replies to outgoing requests.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996